package com.didispace;

import com.didispace.User;
import com.didispace.service.hello.RefactorService;

import org.springframework.web.bind.annotation.*;

@RestController
public class RefactorHelloController implements RefactorService {

	@Override
	public String hello(@RequestParam("userName") String userName) {
		return "Hello " + userName;
	}

	@Override
	public User hello(@RequestHeader("userName") String userName, @RequestHeader("id") String id) {
		return new User(userName, id);
	}

	@Override
	public String hello(@RequestBody User user) {
		return "Hello "+ user.getUserName() + ", " + user.getId();
	}

}